home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10814 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: www.cybercity.dk!usenet
  2. From: monsted@cybercity.dk (Monsted)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
  5. Date: Sun, 17 Mar 1996 12:55:55 GMT
  6. Organization: Monsted Chartering A/S
  7. Message-ID: <4ih0p0$7q5@vip.cybercity.dk>
  8. References: <3148DBB6.1353@hawaii.edu>
  9. NNTP-Posting-Host: 194.16.56.150
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Dave Carien <davec@hawaii.edu> wrote:
  13.  
  14. >Yes or no on this, I just recently got confused by two different books. I 
  15. >assume that the declaration foo[80] allocates storage for elements 0-79. 
  16. >A string could be terminated by doing something like foo[79] = '\0', but 
  17. >foo[80] = '\0' would be invalid because such an element does not exist. 
  18. >Just looking for confirmation that I'm right here. A simple Y or N will 
  19. >do thanks.
  20. >-- 
  21. >-Recently confused C programmer
  22.  
  23. You're right!
  24.  
  25. Jesper
  26. +----------------+-----------------------------------+
  27. | Jesper Monsted | monsted@cybercity.dk              |
  28. | Denmark        |                                   |
  29. +----------------+-----------------------------------+
  30.  
  31.